fix linking with static embree libraries and avx2
fix static builds on hornet
detect gcc on hornet
move system specific build settings to separate files
avoid code duplication