Factories aren't necessarily all for trade, just for mass production.
You could be mass producing medical supplies, weapons, ammunition, tools, vehicles, things that produce/harness energy, pre-fabricated shelters or utilities for them... any number of useful things that either have extremely high trade value or grant you the power/ability to assert dominance/control.
And I really don't think that makes you a huge target for "raiders". I really don't think that crazed lunatics with automatic weapons are going to a thing like you see in the fallout and borderlands games. Namely because terrible people don't tend to get along with other terrible people. I think the crazies and savages are going to mostly kill eachother in disfunctional chaos. Building factories is going to draw in a lot of people and the vast majority of them are going to want to be apart of it in a posititve way. Progress tends to be attractive, especially when it means an improvement to your quality of life and safety.
I'd disagree about resources being all dried up... if the population has been decimated then there should be all kinds of available raw resources lying around. It's just a matter of converting them into a usable form. Probably, after scauaging has taken it's toll, the raw resources that are left lying around are in masses too large to move by hand and heavily oxidized. If you have a foundry and a factory to turn those raw resources into something useful then it's just a matter of hauling every piece of scrap metal you can get your hands on over to your electric induction furnace (or whatever they are using, I guess the FO universe is bigger on nuclear power) and melting it down.
In terms of "staying alive and not dying", finding time, yada yada... A real post apocalypse would be a lot different than the Fallout experience. It would be a lot less exciting... Once you have your basic needs tended to... all you have is time.
Pretty much every study conducted on the topic agrees that members of hunter-gather societies had a lot more time for liesure than the modern working man.