build: Add -static for mingw builds

This avoids a dependency on libssp-0.dll when built with
-fstack-protector-all.