Add .gitignore to exclude files

Don't allow files like .o, .a or .log files to be potentially tracked by
git.