All 3 should have birds rights which is why they decided to have the opt out clause after year 3. They can all opt out to create money for Melo and resign even above cap because of birds right which gives team the right to resign a player that has been with them for 3 years.
This.
And if you're willing to pay the luxury tax you can pretty much resign every player on your team to a max contract if they all have bird rights. There's really no "hard cap" in the NBA like in the NFL. Just a soft cap and a shit ton of taxes once you reach a certain point past the soft cap.