Remove checks from config.m4 and use versions

Also fixes an issue with setting options.