Python script to build makefile dependencies