Fix compiling using MinGW
Add cmake tool chain file for cross-compiling using mingw on GNU/Linux