build system: use AC_SEARCH_LIBS rather than assuming -ldl is needed.