A frequent cause of musty, earthy odors, especially toward the end of the summer, is naturally occurring organic compounds derived from the decay of plant material in lakes and reservoirs. The odors can be objectionable, but generally are not harmful to health. However, odors can be caused by other constituents as well, so you may want to call your local Health Department and mention the odor to them.
In some parts of the country, drinking water can contain the chemical hydrogen sulfide gas, which smells like rotten eggs. This can occur when water comes into contact with organic matter or with some minerals, such as pyrite. The situation mostly occurs as ground water filters through organic material or rocks.
The best way to find out what is in your water is to have the water tested by a state certified laboratory. A list of these labs is available from your State Certification Officer.