Write or overwrite this .MAK file

def write(self, outfilename=None):
        """Write or overwrite this .MAK file"""
        outfilename = outfilename or self.filename
        if not outfilename:
            raise ValueError('Unable to write MAK file without a filename')
        with codecs.open(outfilename, 'wb', 'windows-1252') as outf:
            outf.write('\r\n'.join(self._serialize()))