Freebsd port

Two little patchs, one to have it build, and one to have it run :-)

both submitted by Tobias Berner.