rewrite Makefile

fix common file reused by ktapvm and ktap issue.