Changed to snprintf for safety, updated Makefile to stop using global lib dir