Fix build and link.

Adds the required files for build to succed. Also fixes the issues
with Makefile.
Update .gitignore.