makefile: various improvements

Signed-off-by: engstk <eng.stk@sapo.pt>