If LeBron agrees to come back, they would have room to sign a max player, as long as they sign that player first, then they can go over the cap to sign LeBron, Z, and Shaq if they want.
That's not how it works. There will be a cap hold for all of our free agents against the cap until they are either resigned or renounced, at which point you lose their bird rights.
Here is the explanation from cbafaq.com all about the collective bargaining agreement.
31. Why do free agents continue to count against a team's cap?
It closes another loophole. Teams otherwise would be able to sign other teams' free agents using their cap room, and then turn their attention to their own free agents using the Bird exceptions. This rule restricts their ability to do that. It doesn't close this loophole completely -- for example, in 2005 Michael Redd's free agent amount was $6 million, even though the Bucks intended to re-sign him for the maximum salary. By waiting to sign Redd last, the Bucks were able to take advantage of the difference by signing Bobby Simmons. Had they signed Redd first, they would have had no cap room to sign Simmons.
Basically the Cavs have zero cap room for next year as the cap hold for Lebron alone will eat up most of the available money.
That is why it is vital to make a trade right now, as it is the last shot they have to improve the team until 2 seasons from now as there is no Ben Wallace, Z or Wally next year that could bring back a high dollar player.