fix makefile for write_coils
fix makefile for Bmag