Use PGXN to install pg_repack on postgres 9.6 on top of Ubuntu 14.04
pgxn will install using the PostgreSQL associated with whatever pg_config it finds first in $PATH.  If you set your PATH (either permanently or temporarily) to list first the directory containing that pg_config then that should fix the problem

sudo su
PATH=/some/version/postgres/bin:$PATH
pgxn install pg_repack