It could be 2 things
1. The link sent you to a fake web site and redirected you or...
2. I had this happen to me long time ago on my old PC where I was browsing you-tube and suddenly im in a site thats telling me i had Viruses on my PC and must scan on the web site and, meanwhile my security was telling me that it blocked a malware. I immediately closed the web and hasn't happened in a long time. Its rare and happened only 2 times in my life, most likely will not happen again but fully scan your PC to be sure nothing is on your PC.