Fix out of tree build for MinGW/MSYS