What should I do to prepare to apply to a math PhD program?
(US-specific) The REUs don't matter much for admission. The problem with not having analysis at all on your transcript is that most programs use it as a litmus test for whether you are able to write proofs and handle graduate coursework. The fact that your weaker courses were number theory and abstract algebra is also going to raise red flags in that regard.

There might be programs that would be willing to take you as an MS so that you could remediate, but probably the best course of action is to just register for a year as a post-bac or nonmatric somewhere that offers upper-div math courses.