Use -fPIC only when neccessary, and make compile with mingw