Fix build on haiku
Reviewed-by: Sven Brauch <mail@svenbrauch.de>
As discussed on IRC, also with Friedrich.
On Linux, the symbols needed in the program are
provided by glibc, but POSIX doesn't actually force
them to be there, so on other platforms it might be
a different library.