Port SOCK_RAW ip_len fixes for older *BSD's from pimd

This is a port of the troglobit/pimd#23 patch that was brought
to my attention by Olivier Cochard-Labbé.  See the FreeBSD help
at https://wiki.freebsd.org/SOCK_RAW for details.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Fix bad use of ? operator in fprintf(), found by Clang.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
prune.c:delete_lclgrp() - Fix possible NULL pointer deref thanks to Clang

When g->gt_route i NULL, which the if-clause permits, we may dereference
a NULL pointer.  Found by scan-build (Clang)

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Silence scan-build warnings

Calling logit() wit LOG_ERR never returns.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
main.c:daemin_pid() - Check return value of fscanf() when reading pidfile.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Makefile: Add make check target using Clang scan-build

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Replace static config.mk with configure script from pimd.

No more editing config.mk to build for non-Linux or embedded targets,
simply run ./configure (with optional arguments) to create a custom
config.mk for your system.  Imported from pimd.

Also updated ChangeLog a bit.

Signed-off-by: Joachim Nilsson <troglobit@gmail.com>