At least two people have been killed after a "devastating" building collapse in Brooklyn, New York City's mayor has said.