LIEF only compiles correctly for the second time. The first time you try to build it, it shows:
<dir>/libmem/LIEF/include/LIEF/third-party/span.hpp:20:10: fatal error: LIEF/third-party/internal/span.hpp: No such file or directory
20 | #include <LIEF/third-party/internal/span.hpp>
LIEF only compiles correctly for the second time. The first time you try to build it, it shows: