From what you say it vere well could be a mold problem in your walls.First you have to stop the water from coming in (were ever it may be) it also could be a water line with a leak. After you have to clean up or better remove the mold. A easy way to check for pluming problem is to shut off all sinks tubs ect and make sure they are not leaking. the monitor your water meter. there longer you test the more acuret.if anything i will look out for you
I have rehabed a few houses that really stunk inside! There was one that dofs a urinated into the opening of a pocket door! one of the had a dead cat lodged between the outer wall and bathtub. Each case I used some liquid I bought at a carpet store or a vacuum cleaner store. THis liquid had enzymes in it that would eat organic stuff such as urin, poop etc. I dont have enough information on your project, but it could be many things. I have used paints the the pigmation in them really stunk!
If your house is peir and beam, make sure all the under the subflooring that there is no access for mice. They will leave their droppings etc in the walls or anywhere. Again in this case I'd spray everywhere they have been with the enzyme liquid (purchased at a carpet store) maybein the walls there is mold or under the subflooring? Enzyme should eat mold also. for one house I bought a "mist machine" or "atomizer" that would does similar to the bug spray bombs and I set it under the house to mist/spray the mold under a 1000sf house.
Also if you have carpet and animals or high humidity, the carpet will carry a smell for long periods of time.