I guess that the mentally ill would have suffered an extreme ostracism and violence from the population, but I also think that some of the conditions that lead to homelessness (drugs, alcohol, financial problems) are very recent.
But even for something like depression, many of the behaviors that are known to help would be more prevalent/mandatory in small, close-knit, more primitive societies. For example, you'd probably be getting tons of physical exercise, getting good sleep without artificial light, have frequent contact with a close family/social network, and probably have a pretty fixed routine that would be expected of all members of your cohort within the community. I'm not saying those activities cure depression, but speaking personally and for close friends, those activities make a huge difference.