Fix compiler errors and warnings.
Added Makefile