fix searching for libs when no -l<library> flag is required
fix searching for libs when no -l<library> flag is required

Define a wrapper around AC_SEARCH_LIBS that enhances its behavior:
  * Prepend the -l<library> flag to a prefixed LIBS variable, not to
    LIBS directly
  * Optionally skip prepending the -l<library> flag if the flag
    matches a given pattern

Use the wrapper to fix some bugs:
  * Before, -l<library> would be prepended to PREFIX_LIBS even if no
    -l<library> flag was necessary to use the named function.  If
    <library> didn't exist on the system, the linker would fail.
  * (minor) This configure script tests two different functions from
    OpenSSL.  Before, we assumed that the two would require the same
    LIBS flag, when technically it's possible that one function
    requires a LIBS flag but the other doesn't.

The flags_restore line under the libdl stuff is removed because
RPSTIR_SEARCH_LIBS does not modify user flag variables (unlike
AC_SEARCH_LIBS).

rhansen/rpstir,rhansen/rpstir,rhansen/rpstir,rhansen/rpstir,rhansen/rpstir