andreahopscotch wrote:
If none of these work, check your extensions.
Safari - Preferences - Extensions
Uninstall any extensions you don't recognize.
Note that this is sufficient for some adware, but not for all. InstallMac/Genieo, for example, may install an extension called Omnibar, but that is the smallest part of the infection. There are many other things installed, some very deeply in your Mac, that must be removed if you don't want this junk remaining active, doing God knows what in the background.
Also, note that the InstallMac/Genieo uninstaller is known not to work. These installers do not remove all components of the adware. In fact, the InstallMac uninstaller in particular has been observed to install components that were not actually present!
Use the tool that Kevin recommended to get rid of everything.