MAKEFILE: Add support for building under Haiku

Find the header and library paths with findpaths.

We need -lnetwork for sockets.

We do support pthread, it's in libroot.

We do support dlopen, it's in libroot.
Work around missing nice() on Haiku
Haiku has socklen_t