I believe libxpm comes as part of XFree86 4.x. (which I assume you have installed if you are looking to run emacs under X) At any rate, I have it but have been having a similar problem compiling x3270. ld seems to think that _XpmReadFileTo Pixmap is not defined. However, it is in the library and the header. My configure script leads me to believe that they are findable. Manually pointing the linker at the library did not help. I greped the source for calls to that function in both underscored and non-underscored form, but came up empty. If you come up with a solution please let me know.