ke overhaul: look for external dependencies

and also change HAVE_XXX -> XXX_FOUND (more cmake-y).