Add gcc_s and pthread to LIBS when compiling for mingw.