diff -ur cgx_2.14.1/src.orig/Makefile cgx_2.14.1/src/Makefile
--- cgx_2.14.1/src.orig/Makefile	2018-04-05 13:32:06.000000000 -0500
+++ cgx_2.14.1/src/Makefile	2018-12-11 20:50:49.000000000 -0600
@@ -3,13 +3,13 @@
   -I/usr/include \
   -I/usr/include/GL \
   -I../../libSNL/src \
   -I../../glut-3.5/src \
-  -I/usr/X11/include 
+  -I/opt/X11/include
 
 LFLAGS = \
-  -L/usr/lib64 -lGL -lGLU \
-  -L/usr/X11R6/lib64 -lX11 -lXi -lXmu -lXext -lXt -lSM -lICE \
-  -lm -lpthread -lrt
+  -framework OpenGL -framework GLUT \
+  -lX11 -lXi -lXmu -lXext -lXt -lSM -lICE \
+  -lm -lpthread
 
 
 # on 32bit systems change lib64 to lib
@@ -22,41 +21,6 @@
  userFunction.c
 
 SUTIL = \
- ../../glut-3.5/src/layerutil.c \
- ../../glut-3.5/src/glut_dials.c \
- ../../glut-3.5/src/glut_ext.c \
- ../../glut-3.5/src/glut_mesa.c \
- ../../glut-3.5/src/glut_menu.c \
- ../../glut-3.5/src/glut_modifier.c \
- ../../glut-3.5/src/glut_space.c \
- ../../glut-3.5/src/glut_shapes.c \
- ../../glut-3.5/src/glut_tablet.c \
- ../../glut-3.5/src/glut_warp.c \
- ../../glut-3.5/src/glut_8x13.c \
- ../../glut-3.5/src/glut_9x15.c \
- ../../glut-3.5/src/glut_hel10.c \
- ../../glut-3.5/src/glut_hel18.c \
- ../../glut-3.5/src/glut_hel12.c \
- ../../glut-3.5/src/glut_tr10.c \
- ../../glut-3.5/src/glut_tr24.c \
- ../../glut-3.5/src/glut_bitmap.c \
- ../../glut-3.5/src/glut_cursor.c \
- ../../glut-3.5/src/glut_event.c \
- ../../glut-3.5/src/glut_get.c \
- ../../glut-3.5/src/glut_overlay.c \
- ../../glut-3.5/src/glut_input.c \
- ../../glut-3.5/src/glut_stroke.c \
- ../../glut-3.5/src/glut_teapot.c \
- ../../glut-3.5/src/glut_winmisc.c \
- ../../glut-3.5/src/glut_fullscrn.c \
- ../../glut-3.5/src/glut_cindex.c \
- ../../glut-3.5/src/glut_roman.c \
- ../../glut-3.5/src/glut_mroman.c \
- ../../glut-3.5/src/glut_swidth.c \
- ../../glut-3.5/src/glut_bwidth.c \
- ../../glut-3.5/src/glut_win.c \
- ../../glut-3.5/src/glut_init.c \
- ../../glut-3.5/src/glut_util.c \
  uselibSNL.cpp \
  generateTet.cpp \
  ../../libSNL/src/*.cpp
@@ -66,7 +30,7 @@
 OUTIL = $(SUTIL:.c=.o)
 
 cgx: $(OLIB) $(OUTIL) $(OULIB)
-	g++  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
+	$(CXX)  $(OULIB)  $(OLIB) $(OUTIL)  $(CFLAGS) $(LFLAGS) -o  $@
 
 
 
diff -ur cgx_2.14.1/src.orig/cgx.h cgx_2.14.1/src/cgx.h
--- cgx_2.14.1/src.orig/cgx.h	2018-05-29 14:15:52.000000000 -0500
+++ cgx_2.14.1/src/cgx.h	2018-12-11 20:54:53.000000000 -0600
@@ -89,8 +89,8 @@
     "/usr/local/CalculiX/ccx_2.14/doc/ccx/ccx.html",\
     "/usr/local/CalculiX/cgx_2.8/doc/aflib/aflib.pdf"}
 #else
-  #define     HELPFILE        {"/usr/local/CalculiX/cgx_2.14.1/doc/cgx/cgx.html",\
-    "/usr/local/CalculiX/ccx_2.14/doc/ccx/ccx.html"}
+  #define     HELPFILE        {"@@PREFIX@@/share/doc/CalculiX/cgx_2.14.1/cgx/cgx.html",\
+    "@@PREFIX@@/share/doc/CalculiX/ccx_2.14/ccx/ccx.html"}
 #endif
 
 #define     INITFILE        {".cgx"}
@@ -103,9 +103,9 @@
 #else
 /* #define     BROWSER         {"netscape"} */
 /*   #define     BROWSER         {"mozilla"} */
-  #define     BROWSER         {"firefox"}
+  #define     BROWSER         {"openbrowser"}
 /* #define     PSVIEWER         {"ghostview"} */
-  #define     PSVIEWER         {"gv"}
+  #define     PSVIEWER         {"open"}
 #endif
 
 /* more parameters, better do not change them! */
diff -ur cgx_2.14.1/src.orig/extUtil.h cgx_2.14.1/src/extUtil.h
--- cgx_2.14.1/src.orig/extUtil.h	2018-05-29 14:15:52.000000000 -0500
+++ cgx_2.14.1/src/extUtil.h	2018-12-11 22:17:37.000000000 -0600
@@ -7,6 +7,7 @@
 #else
   #define DEV_NULL   " >/dev/null"
   #define DEV_NULL2 " 2>/dev/null"
+  #include <sys/param.h>
   #include <unistd.h>
 #endif
 
@@ -52,12 +53,10 @@
 #undef min
 #define abs(x) ((x) >= 0 ? (x) : -(x))
 #define dabs(x) (double)abs(x)
-#define min(a,b) ((a) <= (b) ? (a) : (b))
-#define max(a,b) ((a) >= (b) ? (a) : (b))
-#define smin(a,b) (float)min(a,b)
-#define smax(a,b) (float)max(a,b)
-#define dmin(a,b) (double)min(a,b)
-#define dmax(a,b) (double)max(a,b)
+#define smin(a,b) (float)MIN(a,b)
+#define smax(a,b) (float)MAX(a,b)
+#define dmin(a,b) (double)MIN(a,b)
+#define dmax(a,b) (double)MAX(a,b)
 
 
 typedef struct {
diff -ur cgx_2.14.1/src.orig/uselibSNL.cpp cgx_2.14.1/src/uselibSNL.cpp
--- cgx_2.14.1/src.orig/uselibSNL.cpp	2018-05-29 14:15:28.000000000 -0500
+++ cgx_2.14.1/src/uselibSNL.cpp	2018-12-11 22:22:22.000000000 -0600
@@ -934,7 +934,7 @@
   // (5)   create the cgx nurbs
   // printf(" create blended nurbs\n"); 
   buffer[0]='S';
-  buffer[1]=(char)NULL;
+  buffer[1]='\0';
   getNewName( name, buffer );
   for (i=0; i<MAX_LINE_LENGTH; i++) sname[i]=name[i];
   if(printFlag) printf ("store NURS Nr:%d Name:%s\n", anzGeo->nurs+1, name);
@@ -1012,7 +1012,7 @@
     for (j=0; j<nurbs[nr].v_npnt; j++)
     {
       buffer[0]='p';
-      buffer[1]=(char)NULL;
+      buffer[1]='\0';
       getNewName( name, buffer );
       nurbs[nr].ctlpnt[i][j]  = pnt( name, surface->controlPoints()[ index ].x(), surface->controlPoints()[ index ].y(), surface->controlPoints()[ index ].z(), 0);
       point=*pntpntr;  /* update pointer */
