By many accounts, it can't. In order to have a fully naturalist account of mathematics, you need a middle ground between these extremes.
Kant theorized that space and time are not aspects of reality, but instead are formats that our perceptions are fitted into because of the nature of human intuition. It would then be impossible for them to be empirical, because they are necessary parts of the mind that underly our ability to accumulate data. They are, in his terminology, synthetic, a priori facts.
But that does not mean they are a part of some additional reality, as suggested by Platonism. They are instead patterns that we as a species impose on our interpretations of our environment, and that we share with one another and, indirectly, with all other related species.
(Neo-)Intuitionists generalize this to the whole of mathematics and logic, making the range of structures expressed by mathematical and logical objects part of rational psychology, rather than of ontology. Mathematical facts do not describe what is true of anything or even what is truly necessary in the world, but they do dictate what it necessary for humanity to truly grasp any aspect of the outside world and give it a shared expression.
Jungian psychology spreads this notion of shared, underlying structure beyond mathematics and into other realms like the patterns that underly recurrent religious sentiments and story structures, as the genetic component of our collective unconscious experience.
Things like the notion of the repeatability of experience, or our ideals of safety and equality, and their competing notions of the coincidental or miraculous, or the notion of heroism and earned privilege then take on the same nature as mathematical idealizations. This makes mathematics less singular of an endeavor, even if none of the other related tropes are as deeply embedded and thus our reasoning about them can never be equally clear or perfect. And it emphasizes that all human abstractions require a shared underlayment, partially inborn and partially negotiated by elaboration of conventions, in order to retain their stability.