update makefile to allow using non-pypi cheeseshops.
Small refactoring; added some tests.