MinGW fix for linux cross-compilation

Includes mcc's fixes, too(can rebase later if those are merged)