Added dl linking on Linux and Mac.

Added static linking to standard libraries on gmake.