def edit(self, spec, prefix):
        # libquadmath is only available x86_64 and powerle
        # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85440
        if self.spec.target.family not in ['x86_64', 'ppc64le']:
            comps = join_path('amrex', 'Tools', 'GNUMake', 'comps')
            maks = [
                join_path(comps, 'gnu.mak'),
                join_path(comps, 'llvm.mak'),
            ]
            for mak in maks:
                filter_file('-lquadmath', '', mak)

        # Set all available makefile options to values we want
        makefile = FileFilter('GNUmakefile')
        makefile.filter(
            r'^AMREX_HOME\s*\?=.*',
            'AMREX_HOME = {0}'.format('./amrex')
        )
        makefile.filter(
            r'^PRECISION\s*=.*',
            'PRECISION = {0}'.format(spec.variants['prec'].value)
        )
        makefile.filter(
            r'^DIM\s*=.*',
            'DIM = {0}'.format(spec.variants['dims'].value)
        )
        makefile.filter(
            r'^PROFILE\s*=.*',
            'PROFILE = {0}'.format(
                spec.variants['profiling'].value
            ).upper()
        )
        makefile.filter(
            r'^TRACE_PROFILE\s*=.*',
            'TRACE_PROFILE = {0}'.format(
                spec.variants['profiling'].value
            ).upper()
        )
        makefile.filter(
            r'^COMM_PROFILE\s*=.*',
            'COMM_PROFILE = {0}'.format(
                spec.variants['profiling'].value
            ).upper()
        )
        makefile.filter(
            r'^COMP\s*=.*',
            'COMP = {0}'.format(self.compiler.name)
        )
        makefile.filter(
            r'^DEBUG\s*=.*',
            'DEBUG = {0}'.format(spec.variants['debug'].value).upper()
        )
        makefile.filter(
            r'^USE_ARRAYVIEW\s*=.*',
            'USE_ARRAY_VIEW = FALSE'
        )
        makefile.filter(
            r'^USE_MPI\s*=.*',
            'USE_MPI = {0}'.format(spec.variants['mpi'].value).upper()
        )
        makefile.filter(
            r'^USE_CXX11\s*=.*',
            'USE_CXX11 = TRUE'
        )
        makefile.filter(
            r'^USE_VOLRENDER\s*=.*',
            'USE_VOLRENDER = FALSE'
        )
        makefile.filter(
            r'^USE_PARALLELVOLRENDER\s*=.*',
            'USE_PARALLELVOLRENDER = FALSE'
        )
        makefile.filter(
            r'^USE_PROFPARSER\s*=.*',
            'USE_PROFPARSER = {0}'.format(
                spec.variants['profiling'].value
            ).upper()
        )

        # A bit risky here deleting all /usr and /opt X
        # library default search paths in makefile
        makefile.filter(
            r'^.*\b(usr|opt)\b.*$',
            '# Spack removed INCLUDE_LOCATIONS and LIBRARY_LOCATIONS'
        )

        # Read GNUmakefile into array
        with open('GNUmakefile', 'r') as file:
            contents = file.readlines()

        # Edit GNUmakefile includes and libraries to point to Spack
        # dependencies.
        # The safest bet is to put the LIBRARY_LOCATIONS and
        # INCLUDE_LOCATIONS at the beginning of the makefile.
        line_offset = 0
        count = 0
        for lib in ['libsm', 'libice', 'libxpm', 'libx11',
                    'libxt', 'libxext', 'motif']:
            contents.insert(
                line_offset + count,
                'LIBRARY_LOCATIONS += {0}\n'.format(spec[lib].prefix.lib)
            )
            contents.insert(
                line_offset + count + 1,
                'INCLUDE_LOCATIONS += {0}\n'.format(spec[lib].prefix.include)
            )
            count += 1

        # Write GNUmakefile
        with open('GNUmakefile', 'w') as file:
            file.writelines(contents)