First things first - No matter what anyone tells you there are no viruses for Macs, so ignore it. It's a scam trying to get you to buy something you don't need. Same advice for anything else that claims to clean-up or speed-up your Mac. Again all scams trying to get you to buy something you don't need.
At some time in the (possibly recent) past you've visited a (seemingly harmless looking) website that probably prompted you to click something before it allowed you to get you where you wanted to be. At that point you (unwittingly) allowed it to give you a "notification" warning. Seemingly harmless at first that later becomes annoying.
Click on the Safari Menu and select Preferences:
Click on the Websites icon and scroll down to the Pop-up Windows section and select the icon:
Inspect everything in the right hand section that mentions MacAfee and remove it. Anything else in there you don't like the look can also be safely removed. In fact everything that's in there can be safely removed.