To list the databases, you can execute your command as postgres user:
$ sudo su postgres -c 'psql -l'
If you are already logged in as root, you can remove sudo from the above command. User postgres is considered as root user for PostgreSQL database engine.
The error shown in your post indicates that there is no access for user root from localhost to access postgres database. So, you can edit pg_hba.conf file to include the desired login details like login name, DB name, and host. The file is well documented.
For your case, you can add the following line to pg_hba.conf file:
local all root peer
You need to reload your postgresql server after saving the changes.