Thanks a lot to @hunk for finding out why building on Arch was broken! It turns out this also affected Msys2, so I amended the script to always use the needed parameters.
If you're building a Windows executable with Cygwin, you might want to change -lfreeglut_static
back to -lglut
!