Bug in sorting plan.

Was not returning anything.
Make the Makefile more automatic.

Sorry, when I see a Makefile with hardcoded everything, it makes me sad.