Confirmed, thanks for the report!
If you want to hack around it, add "-lgd" to the above command and it will build.
As far as I understand the problem, it tries use the variable GDLIB_LIBS in Makefile.am. This is a problem, as this variable will be first defined by configure - but configure uses the from Makefile.am generated file Makefile.in. I'm not sure how to solve this.