Ensure pthread support compiler and linker flags are correct
On some platforms using AC_SEARCH_LIBS is not sufficient for
finding the linker flags for linking with a pthread library.
Add macro ax_pthread.m4 from GNU autoconf macro archive and
use the macro AX_PTHREAD.
Fix compiler and linker flags for afpd and libatalk.