At 7 months of age the socialization phase has ended, but your dog is still young and able to adapt his behavior. But I strongly suggest you hurry with the training because the longer you wait the harder it will become.
What you describe sounds like a textbook example of insecure behavior. Whenever your dog encounters something unknown, he doesn't know how to react to it and assumes a very slightly aggressive stance, just be sure in case it actually is something dangerous. Over time he might learn that this aggressiveness (like growling) succeeds in making the scary thing (like a strange person) go away. This is a self-rewarding behavior that increases aggressive behavior towards people and/or other animals.
Disrupt aggressive behavior
This may not work but is very much worth trying in case it does work.
Whenever you see him stiffening up and growling, nudge him in the side to disrupt his behavior.
Sounds (like a command) are unlikely to pull him out of his anxious / aggressive mindset, but touch can force him to concentrate on something completely different. The soft flank is the best place to nudge because it's outside of his line of sight and rather sensitive. Please note that it should be a sudden but gentle nudge, not a slap or otherwise painful touch.
As soon as you have his attention, engage him in alternate behavior.
I've also had good experiences with physically turning my dog around (tail facing the person, head facing away from them) to disrupt aggressiveness, but your dog has to be a suitable size for that.
Train alternate behavior
One important step towards breaking this spiral of self-rewarding growling is to offer an alternative that is rewarded more than the growling. This could be sitting or lying down behind you (where it's safe). For the dog this would translate to "Come back to your pack, let me decide whether this is dangerous and let me protect you if it is".
Another alternative that is often implemented and works well is aborting a prey dummy or small treat bag.
You need to train the behavior first in a calm environment. It would also be beneficial to use a unique command for it. Reward the obedience with treats or toys - whatever your dog reacts best to - but not with pettings, because this is distracting from the training.
Once your dog understands the command, start training it during walks at random times. Take the treats or toy with you to offer a reward every single time he obeys your command. At first you'll have to train when he isn't distracted or anxious, but after a few weeks of consequent training you should be able to call him back to you when he's distracted.
Expose him to strange situations
This would have been best done during socialization. It's intended to let a dog experience various situations and thereby become experienced and more secure in their interactions with our human world. Hopefully you'll still be able to introduce him to various strange situations and show him how to cope with them. Many of these things are done for the training of service dogs or in some puppy schools. If you find a puppy school nearby that trains social interactions, you should consider subscribing.
"Strange situations" means anything that your dog may encounter once in a while, but not daily. Unknown objects lying around, slippery floors, rustling sounds. There are a few scenarios you can easily create yourself.
The most important thing to keep in mind is that you must never force your dog to interact with the object. You can encourage him with your voice or by approaching the object yourself, but he must be given the time and freedom to explore on his own.
- Open up an umbrella and put it upright on the floor. Let your dog explore.
- Loosely fix a piece of space blanket in a passage (like a hula hoop, doorway or between bushes) and let your dog walk through
- Put a blown up balloon on the floor or fix it to a bush
- Tie a number of gift wrap ribbons on a broomstick, then suspend it horizontally and let your dog walk underneath it
- If you can find any, lay a metal sheet at least as big as your dog flat on the ground and let him walk over
- If you have a gym / yoga mat, Canvas, tarp or anything similar, lay it flat on the ground and let him explore
- Fill a baby pool with just 1 - 2 inches of water and put a floating object (or several) inside. Let your dog explore
- Put a deliciously smelling treat (like cheese or hot dog sausage) inside an empty pot. Kneel down so your dog could take the treat, but gently tap the pot with a spoon to make noise. Let your dog take the treat from the pot while still making noise
- Set a hair dryer to low heat (or no heat if possible) and blow at a specific spot on the ground. Don't aim directly at your dog. Let him explore
Have a look at more ideas and instructions: SDiT Socialization Checklist
Be a role model
Dogs learn by observing how other dogs and humans around them react. Use this to your advantage by showing him how he could react in a better way.
A word of explanation first. Many people, especially if they know their dog might be frightened by a situation, follow this sequence:
- They stop walking and look at their dog to see how they might react.
- The dog sniffs some and maybe approaches the situation, but ultimately returns to their human.
- The human walks away from the situation.
In dog language this translates to:
- (human) I don't know how to react to this situation. I want you to cope with it.
- (dog) This is scary, better return to my pack.
- (human) You're right, this is really scary. Better run away than cope with it.
If your dog is insecure or anxious, it's far better to be the one coping with scary situations than asking your dog to do it on his own. When you set up a "strange object" scenario as described above, examine and interact with the object to show your dog that you are not afraid and that there's no need to growl at the object. When you meet someone during your walks, tell your dog to sit down, then approach the person friendly and maybe shake hands before continuing walking. Be sure that your dog obeys the command to sit and stay and doesn't attack the person. If you cannot guarantee this, consider putting a muzzle on him.
Tell humans how to behave
If you can, you should tell the humans you encounter on your walks or have as guests in your house, how to behave to decrease the anxiety of your dog.
- At first, don't look at the dog, don't interact with the dog.
- First greet the humans, establish (with your voice and behavior) that these are friends.
- Only after the dog calmed down somewhat can humans interact with him if they want.
- If they want to interact with him, the first thing they do should be giving him a treat to associate the contact with positive experiences.
I realize this is more complicated and may not be possible to implement very often.