fix open calls, nicify Makefile