Allow mod_tls and mod_ssl coexists without interfering each other by renaming the --with-ssl option of mod_tls to --with-tls. This way we can use --enable-ssl/--with-ssl for mod_ssl and --enable-tls/--with-tls for mod_tls.
Completely revamp configure so that it preserves the standard make variables CPPFLAGS, CFLAGS, CXXFLAGS, LDFLAGS and LIBS by moving the configure additions to EXTRA_* variables. Also, allow the user to specify NOTEST_* values for all of the above, which eliminates the need for THREAD_CPPFLAGS, THREAD_CFLAGS, and OPTIM. Fix the setting of INCLUDES and EXTRA_INCLUDES. Check flags as they are added to avoid pointless duplications. Fix the order in which flags are given on the compile and link lines.