Fix conditional builds

This patch fixes it so that the many different --enable/--disable
options cause the build to still work properly.