Add makefiles and fix some build warnings.