add support for non-linux POSIX systems

These patches add missing #include directives, use portable POSIX functions and add Makefile rules for MacOSX (should work on BSD and maybe even cygwin/mingw systems as well).

Also, minisat is built like and in-tree, to avoid dependency to the broken macports minisat.

Tested on OSX/macports.