Update link.c

Compiles fine, but lots of warnings that we probably need to get rid of.  Not sure if it will work with the other implementations.