Below is a patch to enable link to library provided from mingw32/mingw64 on msys2.
You can build vim.exe/gvim.exe with if_python like below.
mingw32-make -f Make_ming.mak GUI=no IME=yes MBYTE=yes ICONV=yes DEBUG=no PYTHON=c:/msys64/mingw64 PYTHON_HOME=c:/msys64/mingw64 PYTHONINC=-Ic:/msys64/mingw64/include/python2.7 DYNAMIC_PYTHON=yes PYTHON_VER=27 DYNAMIC_PYTHON_DLL=libpython2.7.dll ARCH=x86-64 STATIC_STDCPLUS=yes %*
For example, cpsm (https://github.com/nixprime/cpsm) doesn't work with conbination of mingw-gcc and python2 that is downloaded from python official site. But this fix the problem.
- mattn