'Patch makefile, making CFLAGS more forgivable to older toolchains'

def grubby_install_patch_makefile(self):

    cflags_line = 'CFLAGS    +=    $(RPM_OPT_FLAGS)    -std=gnu99    -ggdb\n'
    libs_line = 'grubby_LIBS    =    -lblkid    -lpopt    -luuid\n'
    shutil.move('Makefile', 'Makefile.boottool.bak')
    o = open('Makefile', 'w')
    for l in open('Makefile.boottool.bak').readlines():
        if l.startswith('CFLAGS    +=    '):
            o.write(cflags_line)
        elif l.startswith('grubby_LIBS    =    -lblkid    -lpopt'):
            o.write(libs_line)
        else:
            o.write(l)
    o.close()
