Shakespeare's plays take a number of liberties, and were at times used as Tudor propaganda. Richard III made for an excellent villain against the backdrop of trying to make Henry VII seem heroic. Shakespeare characterizes Richard as being Machiavellian, the term Machiavel at the time Richard III was published was already understood to denote an individual who embodied the negative aspects of Machiavellianism.
However, contemporary to Richard III's time, Niccolo Machiavelli was essentially unknown. His grand fame came posthumously when The Prince was published in 1532, five years after his death. The Prince essentially coined the idea of a Machiavel.
I don't know the line in that play you're referring to, but if Shakespeare mentions it, it is to the benefit of his audience in the 'present' time in the 1590s. Elizabeth I was queen, and the audience would have recognized the reference even though no one in Richard III's time would have had any notion of it.