makefile works, segfault eliminated when it runs without display