Fix linking on SmartOS/Illumos/Solaris. (#3)