Can we please get a consensus on what a "work" means.
In general, it would be any action on anyone's part to merit salvation.
When Paul was discussing the issue, he was addressing the problem of Jews (primarily Pharisees) who believed that they could be justified by "the deeds of the Law", meaning by obedience to the 613 commandments in the Torah. They forgot that justification was always by grace through faith, beginning with Abel.
So a "work" is that which is done to earn or merit salvation. All religions -- other than Bible Christianity -- teach that a man's good deeds are necessary to earn or merit salvation, and if there is not sufficient merit in this life, there will be many lives (through reincarnation) by which a man can obtain salvation (Nirvana for Hindus, Paradise for Muslims, who do not believe in reincarnation but in good deeds according to the Koran).
However, the Bible teaches very clearly that nothing which we do can earn our salvation, since the sin debt remains in question, and unless we are as perfect as God Himself, we remain unsaved. However, when we believe on the Lord Jesus Christ and what He accomplished for our redemption, and receive Him by faith as Lord and Savior, with genuine repentance, then God imputes His righteousness to us. Since Christ was literally made SIN for us (He who knew no sin), and paid our sin debt in full, we are given the gift of Christ's righteousness purely through the grace of God. That is why it is called "Amazing Grace".