Compile under FreeBSD

Allow primecoin to compile under FreeBSD.

Specifically, FreeBSD's signal() has this prototype:

typedef void (*sig_t) (int);
sig_t signal(int sig, sig_t func);

Include files are in /usr/local/include and library files are in /usr/local/lib.
FreeBSD's dl* functions are in libc. libdl does not exist.

db47 is hardcoded. Having some code to autodetect it may be better.