Build: configure: Use AC_SEARCH_LIBS for basic libraries.
- Get rid of the check for getopt_long, which is no longer used anywhere.
- Use AC_SEARCH_LIBS for finding libdl, but because that macro always adds the result of the test to $LIBS, we have to use a trick: save $LIBS, search for libdl, set $DL_LIBS to the result, and then restore $LIBS.
- Change LIBADD_DL to DL_LIBS for future consistency.
- Get rid of the "Where is dlopen?" block. I think AC_SEARCH_LIBS makes this unnecessary.
- libcrmcommon links against socket and is used by everything, so we can just simply call AC_SEARCH_LIBS for it.
Related T876