configure: Only use -lnetwork on Haiku

libnetwork also exists on Darwin, but is for different things.

While at it, only add the Windows-specific libraries on Windows.