linux: Link necessary libraries

This fixes linking problem on some systems, see #500.