Improve SDK Makefile rules to avoid unnecessary rebuilds