@coquelicot: This confusion illustrates the universal need for definitions if one wishes to be understood. I certainly meant by "amateur" the meaning its word origin implies: namely one who does the activity out of love, rather than to earn a living by it. Thus to me there is no contradiction in calling a great mathematician also an amateur.
Since you ask, it seems to me that Archimedes earned his keep more by his applied works, such as his construction of defensive military engines in the defense of Syracuse, but his pure mathematical results were apparently done for the love of the research. He was certainly a great mathematician. Of Euclid's life we know very little, but it is generally agreed that he was not a great mathematician, although in my opinion he did write a great text book, whose results seem mostly to be the fruit of other mathematicians' research.
There is no challenge offered here to your opinion that Fermat was a great mathematician, but
it is easy to find fairly knowledgable references to Fermat as an amateur:
https://artofproblemsolving.com/wiki/index.php/Pierre_de_Fermat
"Pierre de Fermat (August 17, 1601 – January 12, 1665) was a French magistrate and government official. He, however, is most famous for being an amateur mathematician."
Perhaps you might grant that Stephen Wolfram is not entirely stupid:
https://scienceworld.wolfram.com/biography/Fermat.html
"French lawyer who pursued mathematics in his spare time. Although he pursued mathematics as an amateur, his work in number theory was of such exceptional quality and erudition that he is generally regarded as one of the greatest mathematicians of all times."
Here also is one source to back up your opinion that greatness should not be called amateurism:
https://simonsingh.net/books/fermats-last-theorem/who-was-fermat/
"He was a truly amateur academic and E.T. Bell called him the Prince of Amateurs. However, when Julian Coolidge wrote Mathematics of Great Amateurs, he excluded Fermat on the grounds that he was ‘so really great that he should count as a professional.’ "
Even this reference however makes clear that Coolidge did consider Fermat as technically an amateur.
But I think you can relax. I.e. even people who call Fermat an amateur do regard him as truly great.
Cheers.