Last year, I killed 13 in-ground yellowjacket nests. In any given year, I kill a bunch. The best time to find the nests is early, when the sun is shining at an angle and you can see the nest traffic. My guess is that your fence work is close to the nest and possibly the vibration from a hammer gets them pissed off. Once you find the entrance hole(s), killing them is simple.
Remember landmarks or visual cues during the daylight to remember where the holes are. Sometimes, a pointer stick can be carefully laid to help you; just don’t cover the exit! Then, use a flashlight/headlamp at night to kill them using one of the following methods:
An old standby is to pour about a pint of gasoline down the hole at night; then, immediately cover the hole with a shovelful of dirt. This seals in the fumes. Gasoline vapors sink and will destroy the colony. Do not light it on fire, as some say; that is dangerous and pulls gasoline vapors out of the hole.
In vegetable gardens, where I do not want to add gasoline to the soil, I’ve used the strongest, cheapest vodka I can find, instead of gasoline. Twice, days after the hornets were killed, skunks dug up the pickled nests and ate the vodka-laden dead insects. Bet they had hangovers!
A third method, where I had perennials right next to the nest, avoids solvents that might kill plants: At night, take a trowel and drop about a cup of sevin dust right over the hole(s). The yellowjackets may dig it out, but they’ll track the insecticide into the nest on their feet and abdomens, ultimately killing them. On large colonies, you may need to repeat this step.
A fourth way, which is useful in certain circumstances, is to generate sulphur dioxide gas and trap the fumes over/in the nest. In the “old days”, you could get smoke bombs that would do the trick. Mixtures of 35% powdered sulphur, 38% Potassium nitrate and about 27% sugar should work, stuffed into a paper tube with match heads in the top to start the flare. A metal bucket on top could serve as an effective lid, if the edges were sealed with soil. Plan on wearing disposable clothing and showering afterwards; any drift of that on you will make you reek. By omitting the sulphur in the top inch of the flare, you can start it with minimal stink, get it covered, and back away before the sulphur starts to smolder. I’ve used these to kill large numbers of voles, by plunging the lit flares into tunnels. Avoid starting a fire!
Skunks feed on yellowjackets. I’ve often wondered if skunks could be lured to nests by sprinkling some sardines near the nest. Yeah, in suburbia you might get the neighbor’s dog or cat; but out here, in the sticks, there are no pets hanging around.
Yellowjackets can “tag” you with an attack pheromone when they sting. This means you’re “it”, and they’ll follow the odor trail when you run. I’ve had them follow me into the house. Large nests can be lethal and even small nests are dangerous to anyone allergic to their sting.