Not much you can do about those. They find their way to you not only by carbon dioxide as you breathe but by the salt in your sweat.
We had them in the saltmarshes on Long Island's south shore. I never found anything that was at all effective in repelling them. I used to smoke cigars and a pipe for gnats and mosquitos. In that regard, those 2 things were somewhat helpful. But any thing like those or any insect repellent was almost totally useless for those darn flies. They bit right through it on your skin!
Generally they were a July 1st through mid August pest but like with so many insects, they can't read a calendar