Changed makefiles, fixed .gitignore

To conform to ~/lib structure.