[build][core] rules graph: merge lemmas in key <lemmas>