Samples: Clean-up makefiles so they use dependencies to know if it should
build the Java.