add error msg to graph.py
fix build flag