Don't use root for compile. Create a root user and compile and use wallet as non-root user:
from root:
adduser yourUsername
> you will prompt to insert password, you can't see char while typing, only a security feature, don't be sad about that.
When ask about name/credential press Enter like 4 times, and your user will be created.
now retype the first command, with <sudo> at the end
adduser sameUsernameAsBefore sudo
reboot and login whit these credential.
You have to recompolite it, or chmod the wallet, but in my opinion you have to recompile with not-root user.