build: Do not add -g to HOSTCFLAGS

The flag is not unconditionally added to CFLAGS either and the
programs built on the host do not get habitually fed to a debugger.
configure: Detect newer (>=4.1) versions of MinGW32

The MinGW32 project is deprecating its old version macros.
configure: Add -D__USE_MINGW_ANSI_STDIO=1 to CPPFLAGS on MinGW32

This enables a more C99-compliant implementation of printf et al.
build: Merge pthreads/w32threads OBJS declarations