modifying for use with mac osx and adding cgminer files