updated triangle.c and added Makefile