Improve Makefile and add .gitignore

- Add automatic dependency.
- Add flags -Wextra and -g to improve debugging.
- Link libxia.
Link applications against libxia

- Drop local copies of files now provided by libxia.
Fix compiling warnings due to -Wextra