  Tracking the formation and evolution of dark matter haloes is a critical
aspect of any analysis of cosmological $N$-body simulations. In particular, the
mass assembly of a halo and its progenitors, encapsulated in the form of its
merger tree, serves as a fundamental input for constructing semi-analytic
models of galaxy formation and, more generally, for building mock catalogues
that emulate galaxy surveys. We present an algorithm for constructing halo
merger trees from AbacusSummit, the largest suite of cosmological $N$-body
simulations performed to date consisting of nearly 60 trillion particles, and
which has been designed to meet the Cosmological Simulation Requirements of the
Dark Energy Spectroscopic Instrument (DESI) survey. Our method tracks the cores
of haloes to determine associations between objects across multiple timeslices,
yielding lists of halo progenitors and descendants for the several tens of
billions of haloes identified across the entire suite. We present an
application of these merger trees as a means to enhance the fidelity of
AbacusSummit halo catalogues by flagging and "merging" haloes deemed to exhibit
non-monotonic past merger histories. We show that this cleaning technique
identifies portions of the halo population that have been deblended due to
choices made by the halo finder, but which could have feasibly been part of
larger aggregate systems. We demonstrate that by cleaning halo catalogues in
this post-processing step, we remove potentially unphysical features in the
default halo catalogues, leaving behind a more robust halo population that can
be used to create highly-accurate mock galaxy realisations from AbacusSummit.
