Fix link flags order for MSYS2/MinGW.