"To those who by persistence in doing good seek glory, honor and immortality, he will give eternal life." Rom 2:7
Paul knew, of course, that we cannot justify ourselves. Justice/righteousnsess comes from God, alone, as we turn to Him in faith. But then we must walk in that free gift, in that light. And we may or we may not. So, even though the works themselves are matters of grace, coming from God, we can resist grace, we can fail to remain in Him, fail to perservere. So merit after justifaction is a theme of the new testament, as the quote above shows. Works of grace motivated by love we're given, not works of the law motivated by self-interest. So, again:
2007 With regard to God, there is no strict right to any merit on the part of man. Between God and us there is an immeasurable inequality, for we have received everything from him, our Creator.
2008 The merit of man before God in the Christian life arises from the fact that God has freely chosen to associate man with the work of his grace. The fatherly action of God is first on his own initiative, and then follows man's free acting through his collaboration, so that the merit of good works is to be attributed in the first place to the grace of God, then to the faithful. Man's merit, moreover, itself is due to God, for his good actions proceed in Christ, from the predispositions and assistance given by the Holy Spirit.