Using the postgres image version 9.6.1-alpine, the command pg_config returns wrong definitions for the include directories. After installation of the package postgresql-dev, the header files are located in /usr/include/postgresql/ without the local prefix.
$ pg_config
...
PKGINCLUDEDIR = /usr/local/include/postgresql
INCLUDEDIR-SERVER = /usr/local/include/postgresql/server
...