improved makefiles

- fixed predefined makefile variables usage;
- improved dependency rule.
doxygen generated doc