This may be a well known "fix" but I learned it many years ago from a watchmaker.
Damaged Internal ThreadIf you have a clogged or lightly damaged internal thread, and you don't have a tap of the right size, a spare bolt of the correct size can be used to fix it. Simply file down part of the bolt thread as shown in the photo, and screw it into the damaged thread. It will clear the accumulated crap and straighten out any minor damage to the thread.
Damaged External ThreadIf you do't have thread dies, lightly damaged or clogged external threads can be cleaned/repaired using a thread file, as shown in the photo. These have a series of serrations that are matched to thread pitches, and you simply run it over the damaged portion of the male thread. See this video for info on use of a thread file.
https://www.youtube.com/watch?v=dYu_fl59Ztw