Celtics still have a better championship winning percentage and they do it with a salary cap and luxury tax and MLEs and LLEs and Bird Rights and veteran minimums and all those fun things.
Celtics are the best franchise in sports. Yankees are not.
I love the Celts but 15 of 17 titles occurred before any of the salary restrictions you mentioned. 9 of the 17 came in years the NBA consisted of 8 teams which means the title was roughly the equivalent of an AL pennant of which the Yankees have 40.
Attempting to compare any North American professional sports franchise's championship resume against the Yankees is a losing proposition. It says a lot about the C's that their resume is such that you have to analyze it a bit before determining that they're 2nd or 3rd best.