More generic and maintainable makefile for SelfTest