Add hash function, fix Makefile