Overhaul configure option and CFLAGS handling.