[debug] Add logging facilities
[makefile] Fix and clean (refactor)