--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -2,17 +2,14 @@
 
 pkglibdir = $(PLUGIN_DIR)
 
-AM_CXXFLAGS = $(PANOGLCXXFLAGS) $(PLUGIN_CXXFLAGS) 
+panoglview_SOURCES = panoapp.cpp panoframe.cpp panointeractivecanvas.cpp panocanvas.cpp boundaries.cpp
+panoglview_CXXFLAGS = $(WX_CXXFLAGS)
+panoglview_LDADD = $(WX_LIBS) $(WX_GL_LIBS)
 
-panoglview_SOURCES = panoapp.cpp panoframe.cpp panointeractivecanvas.cpp panocanvas.cpp boundaries.cpp
-
-panoglview_LDADD = $(PANOGLLDADD)
-
-noinst_HEADERS = panoapp.h panoapp.h panoapp.h panocanvas.h panoframe.h panoglplugin.h panocanvas.h panoframe.h panoglplugin.h panopluginframe.h panocanvas.h panoframe.h panoglplugin.h panopluginframe.h panointeractivecanvas.h boundaries.h
+noinst_HEADERS = panoapp.h panocanvas.h panoframe.h panoglplugin.h panopluginframe.h panointeractivecanvas.h boundaries.h
 
 #if WIN32_BUILD
 
-EXTRA_DIST = panoglplugin.h panoglplugin.cpp
 
 #else
 #
@@ -24,6 +21,6 @@
 #
 #
 
-EXTRA_DIST = smallicon.xpm
+EXTRA_DIST = panoglplugin.h panoglplugin.cpp smallicon.xpm
 
 #endif