The answer is to limit and/or control ventilation. You want to make sure that there is little to no ventilation of the odours/gazes into the space (tent/hut/...) where humans are using the toilet.
This might be more or less practical depending on your specific setup, or rather how sophisticated your "hole in the ground" actually is.
What I have done in boy scout camps when building outdoor hole-in-the-ground toilets:
- Dig a hole
- Place a "toilet box" on top of it. This toilet box is basically a DIY toilet seat, i.e. a wooden box with a circular cut-out on top to sit on.
- Make sure that the toilet-box is sealed against the ground on the edges - can easily be achieved using some of the earth which you dug out of the hole.
- Make sure the toilet box has a good sealing lid, to close the hole when not in use.
This will keep most of the odours contained, and will attract less flies. Also there will not be many flies in the hole/box, meaning they won't annoy you "from below" when doing your business.
Alternatively, if you can support an even better and more long-term setup: In addition to the above include a venting duct/flue which attaches to the box and raises up and away from the actual toilet space (tent/hut/...). This will let the odours escape, but further away from where you'll be doing business.
Furthermore, make sure there is good ventilation with fresh air of the toilet space. This is easy if your "hole in the ground" is, actually, just a hole behind some trees, but if you are building a tent/hut/... on top then including windows or other means to increase air circulation is mostly a good idea (depending in the weather). It certainly makes it more agreeable for users by reducing odours and in my experience also leads to less flies, since they love to gather in stuffy wind-protected spaces.