simplify compilation, make compatible with minGW on windows