Here is a bit of an explanation, as opposed to a solution.....it's ammonia....The chemical make-up of ammonia is NH3. This means that there is one Nitrogen atom bound to three Hydrogen atoms. Ammonia can be a weak acid or a weak base, depending on what type of chemical it is suspended in. Ammonia has a strong, pungent odor that is easily recognizable in cleaning products, cat urine, and, for some people, sweat!
The key to ammonia in urine and sweat is the nitrogen. The only macronutrient in your body that contains nitrogen is amino acids, the building blocks of protein. In fact, many bodybuilders are always seeking a "positive nitrogen balance" meaning that less nitrogen leaves their body than enters their body. Since nitrogen is in every amino acid, and amino acids are the building blocks of muscle, someone in positive nitrogen balance is more than likely gaining muscle mass.
Your body uses amino acids for energy every day. There is no way to avoid this. Your body constantly goes into catabolic (tissue breakdown) and anabolic (tissue building) phases. When you accumulate mass (lean or fat), your anabolic phases exceed your catabolic phases, but you still experience both phases. When your body uses an amino acid for energy, it must convert the amino acid to a useable form of energy.
It does this by stripping the nitrogen atom off of the molecule. The skeleton molecule that is left behind is then further converted into glucose and used as fuel. In order to get rid of the excess nitrogen, your body typically processes the nitrogen in your kidneys and forms urea, CO(NH2)2 - basically, a carbon dioxide molecule bound to nitrogen and hydrogen. Urea is then excreted in the urine. If your kidneys cannot handle the load of nitrogen, then the nitrogen will be excreted as ammonia in your sweat.
One other factor to consider is water intake. The methods used for getting rid of excess ammonia, such as urine and sweat, all require water as a transport mechanism. If you are not getting adequate fluid, then the solution (ammonia + water) will not be diluted. Therefore, water plays a definite role. If you are not drinking enough fluids to have at least one or two clear urinations every day, you should drink more.
Based on this explanation, it is clear that your sweat will smell like ammonia only if an excessive amount of amino acids are being used for energy, or you are not receiving adequate water. This helps us find a solution to the problem.