configure.ac: improve check for clock_gettime library
* configure.ac: When using AC_SEARCH_LIBS, handle the case in which that function returns "none required". Also, save and restore LIBS around the check, and properly m4-quote the first argument to AC_DEFINE. Finally, also set and AC_SUBST LIB_CLOCK_GETTIME. This added code is very similar to that provided in gnulib's clock-time.m4. * tests/Makefile.am (LDADD): Append $(LIB_CLOCK_GETTIME).