Fixing linking of core libraries with MPI on Windows