Refactor Makefile to ease testing

Add `test` task to Makefile to ease development testing.

Introduce some minor changes to make more easy reuse this base
makefile.