Fly poisons
Even going back to the 40s and 50s, most books of household hints will suggest using an actual fly spray to kill flies. The Laurel Recipe Book and Household Guide recommended one called Flit (made by Laurel), which “contains DDT and Pyrethrum and is the most deadly of all insecticides, though entirely harmless to humans”, and which was “a truly wonderful insect killer with a fresh fragrance that makes it a pleasure to use”.
The CWA Cookery Book, Tenth Edition did include this gem, though:
Twenty drops of carbolic acid evaporated from a hot shovel will help to banish flies from a room, and a piece of camphor gum held over a lamp until consumed will do for mosquitoes.
If you run into trouble with your carbolic acid, the Modern Household Encyclopedia has this remedy for carbolic acid poisoning:
Give 1 tablespoon Epsom salts mixed with 4 egg whites and milk; or Epsom or Glauber salts in water, vinegar, or soapsuds; or lime water; or raw egg whites in water. Do not give any oils or fats. Brandy or strong black coffee may be given as stimulants, preferably injected through the bowel. Apply external heat on arms and legs.
For a less lethal alternative, try this remedy from Household Hints:
Mix together half a teaspoonful of powdered black pepper, one teaspoonful of brown sugar and one of cream and place it in room on a plate, and flies will disappear.