Simplify network libraries detection with AC_SEARCH_LIBS

AC_SEARCH_LIBS first tries to link without any lib, then tries each
library, and sets $LIBS correctly in any case.

cf.
https://www.flameeyes.eu/autotools-mythbuster/autoconf/finding.html
Simplify socklen_t type detection

The previous version of AC_CHECK_TYPE() which didn't accept passing headers
is obsolete anyway. The new one can be told which headers to include.

Also test for sys/socket.h just for sanity.

cf.
https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html
https://www.gnu.org/software/autoconf/manual/autoconf-2.64/html_node/Generic-Types.html
https://svn.opendnssec.org/home/jerry/memory-usage/ldns-1.6.10/acx_nlnetlabs.m4
Drop AC_ISC_POSIX which is obsolete

It's actually a NOOP in latest autoconf.

cf.
https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html#index-AC_005fISC_005fPOSIX-2084
Merge pull request #108 from mmuman/buildsystem-cleanup

Buildsystem cleanup