Fixed error in quick sort and added test

Fixed error in quick sort that happened when there were too many
identical elements.  Also added to the Makefile and sort testing.