enhance logic of ext/src Makefile