Changed read mode on makefile to rw. Also changed basestring to str. It now works with python3 for my purposes.