build.sh: Properly detect homes for root and users, fixes #1