The xinput library that comes with the MinGW toolset is linking to the XINPUT1_3.DLL. This DLL is only installed by the legacy DirectX End-User Runtime, so it's not present on all machines. Also, this DLL has known security issues.
A better solution is to have libxinput.a link to XINPUT9_1_0.DLL which is present on all Windows machines from Windows Vista forward.
Alternatively, use XINPUT1_4.DLL which is present on Windows 8.0 or later and is also inbox.