Fix library linkage on Solaris