Use AC_DEFINE instead of setting CFLAGS and CXXFLAGS directly
Warn when trying to use threads when --disable-threads was used.