Fix -g option with relative path

Because later on directories will be changed, the path to pg_config must
be converted to an absolute path before proceeding.
Don't use GNU sed specific features

The use of the -r option wasn't necessary here anyway.