fixed makefile to build on IRIX by auto-detecting it needs to link with