This patch is from the FreeBSD 10.0 devel/gdb port and adds the LDFLAGS to link command line with Python enabled. Note, this may effect some hosts if there are library clashes.