Fixed a bunch of Wshadow warnings. Replaced Makefile with one that has better support for automatic targets and dependencies.