Checkpoint: re-org some flags and get HAVE_CONFIG_H back