Fix libraries to link per platform

Reported in #199.

/cc @deepakprabhakara