Have you followed the msys2 directions here?
http://mongoc.org/libmongoc/current/installing.html#build-environment-on-windows-with-mingw-w64-and-msys2