add proper Makefile and support for UPPER_THRESHOLD