build: define HAVE_LIBxxx when we find a library