We have a terrible time with flies, too. Best deterrent is to keep things as cleaned up as possible, as they breed in the poo. Then those fly bags are very effective, the ones you fill with water and smell hideous. Hang them down wind. When things have gotten really bad i lay out those super sticky fly sticks, not the hanging fly paper, but the cylinder ones. i'll set them on the ground wherever the animals can't get to them and they seem to fill up quickly.
i've read about hanging vanilla scented car deodorizers. Tried that and they didn't work. Have also tried fly predators. But they are expensive and i didn't think they helped much.