fixes some errors in examples

- simplifilies example2
- fixes examples/makefile to compile individual examples