I've had this problem before & I have hard water, so it was a fight to figure out.
Do you have a high efficiency top loader?
First things first--the
stripping. The fact that you have ammonia smells & your lo is reacting to it means you have bad levels of bacteria in your prefolds. So, just this one time, you need to pull out the big guns: bleach. For the record, I HATE bleach, but I think that there are some circumstances where it is the most economical, environmentally ok choice.
Please do a bleach & vinegar soak in the washer. Add a half cup of vinegar and a couple capfulls of bleach in warm water. Add prefolds & let sit overnight, or at least a couple hours. Next morning, run a wash to clear out the bleach water. This will KILL the bacteria. The vinegar gives it a boost too, and gets rid of the left over ammonia crystals. Please do this in the machine. This way any bleach smells are kept to a minimum. Then add in about a quarter cup of homemade soap (I'll give you the recipe), a cup of baking soda and wash on the hottest & longest setting again. To make sure the bleach is all gone, I like to run an additional wash, just water.
All the above is to strip them & get rid of bacteria.
I've found that all detergents leave a residue, especially purex. I can feel it on the prefolds--ick. Someone gave me a homemade soap recipe that's pretty cheap. It will last you a while. More so with a fl, but it's not bad with a top loader.
Homemade Diaper Soap
Equal parts:
Washing Soda (aka Sodium Carbonate--if you can't find it in the laundry aisle, check the pool aisle, there's a ph booster product that's 100% sodium carbonate)
BoraxOxiclean(or any knockoff brand. I use the regular oxiclean).
That's it. Just mix it all together. Use 1-2tbs for a FL, about a 1/4c for a top loader.
The above soap is awesome. It has NOTHING that will build up in a diaper. It washes out easy--even in hard water. It's helped me a lot.

:
As for washing, I toss in my prefolds with a couple tablespoons of the above soap, run a hot, long cycle, then run another cold cycle to get any residues out. If I want to really get them clean, I put in about a cup of vinegar in the first wash, to get rid of the pee easier. I then add in about a cup of baking soda in the second wash. If you use VINEGAR or BAKING SODA in ANY of your washes, you need to use the other as well. Using both balances the ph on your diapers. Not a big deal when the diapers are dry, but when wet, you really don't want something really alkaline or really acidic against your baby's skin. Just separate them from each other. If I'm feeling lazy, I'll put vinegar in the rinse cycle (I use a downy ball for the top loader) and baking soda in the drum.
hth!
Ami