Developing on OSX can be an enormous headache (or pain elsewhere) without libreadline. No, libedit is not a suitable substitute. Sorry, David Wheeler. Here's how to use your homebrew install's libreadline
export PG_PREFIX=/home/foo/9.4
export PGPORT=5494
./configure \
--enable-cassert \
--enable-debug \
--enable-depend \
--prefix=${PG_PREFIX:?} --with-pgport=${PGPORT:?} \
CFLAGS="-O0" CPPFLAGS="-I$(brew --prefix readline)/include" LDFLAGS="-L$(brew --prefix readline)/lib"