Fix incompat with Linux

In Linux, we should use 'ld' to link objects. Also change code to be
compiled by old gcc.