Effective uid is not 0, is sudo installed setuid root?
Boot to Recovery Mode(cmdR)/Internet Recovery Mode (altcmdR).
Get the name of your main system volume: df
Usually it's the "Mounted on"- name of the device disk0s2 (e.g Macintosh HD) - simply check the sizes.
Enter chmod 4511 /Volumes/Name_Of_Sys_Vol/usr/bin/sudo

Replace Name_Of_Sys_Vol by the volume name found in the previous command. If the name contains spaces, escape them with \. Example:

chmod 4511 /Volumes/Macintosh\ HD/usr/bin/sudo

Check with ls -l /Volumes/Name_Of_Sys_Vol/usr/bin/sudo which should yield:

-r-s--x--x  1 root  wheel  168448  7  9  2016 /Volumes/Name_Of_Sys_Vol/usr/bin/sudo





In Sierra with SIP enabled you wouldn't have been able to modify the permissions of sudo to 777. Therefore I assume Sierra isn't installed or SIP is disabled.

If Sierra is installed and SIP is enabled you have to disable it before applying changes to sudo..