First, use Malwarebytes Anti-Malware app to remove all malware plugins and apps. Then, select System Preferences, click Profiles. Click on profile (See picture below.) It shows the settings. If you see any website address not known to you (e.g. weknow.ac in the picture), delete the profile. Don't delete any other profiles provided by your company or school. Restart. Go back to Profiles (it could be gone by now if you had malware profiles only) to make sure it is gone. Now, you can change the homepage in your browser.

Mystery solved.