You can use a bat or similar on the first few roaches and rodents to save ammo without putting points into melee, especially if you use VATS.
To have enough ammo, just set the difficulty to hard. It's not really much harder for an experienced player but there will be much more loot, especially energy weapons. The rocket factory is almost a lifetime supply on hard
One thing I do is put a lot of points into repair and carry the +repair jumpsuit with me. That lets me take 5 near worthless raider armors and combine them into one high-priced armor to carry home with me to sell. It also lets me not need to spend much on repairs. More money = easier to buy ammo.