 diff --git a/Makefile b/Makefile
-index 6b91612..5b6e149 100644
+index 6b91612..ff11574 100644
 --- a/Makefile
 +++ b/Makefile
-@@ -986,7 +986,7 @@ BUILTIN_OBJS += builtin/verify-tag.o
- BUILTIN_OBJS += builtin/write-tree.o
- 
- GITLIBS = $(LIB_FILE) $(XDIFF_LIB)
--EXTLIBS =
-+EXTLIBS = -Wl,--start-group -lppapi_simple -lnacl_spawn -lnacl_io -lppapi -lppapi_cpp -lcli_main -Wl,--end-group
- 
- GIT_USER_AGENT = git/$(GIT_VERSION)
- 
-@@ -1710,7 +1710,7 @@ git.sp git.s git.o: EXTRA_CPPFLAGS = \
+@@ -1559,6 +1559,8 @@ ifneq ("$(PROFILE)","")
+ endif
+ endif
+ 
++EXTLIBS += -Wl,--start-group -lppapi_simple -lnacl_spawn -lnacl_io -lppapi -lppapi_cpp -lcli_main -Wl,--end-group
++
+ # Shell quote (do not use $(call) to accommodate ancient setups);
+ 
+ SHA1_HEADER_SQ = $(subst ','\'',$(SHA1_HEADER))
+@@ -1710,7 +1712,7 @@ git.sp git.s git.o: EXTRA_CPPFLAGS = \
  	'-DGIT_INFO_PATH="$(infodir_relative_SQ)"'
  
  git$X: git.o GIT-LDFLAGS $(BUILTIN_OBJS) $(GITLIBS)

 
 git-imap-send$X: imap-send.o GIT-LDFLAGS $(GITLIBS)
-	$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
+	$(QUIET_LINK)$(CXX) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \
 		$(LIBS) $(OPENSSL_LINK) $(OPENSSL_LIBSSL) $(LIB_4_CRYPTO)
 
 git-http-fetch$X: revision.o http.o http-walker.o http-fetch.o GIT-LDFLAGS $(GITLIBS)
-	$(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) $(filter %.o,$^) \

 	sigchain_push(SIGTERM, two);
 	sigchain_push(SIGTERM, three);
diff --git a/test-string-list.c b/test-string-list.c
index 00ce6c9..725bed7 100644
--- a/test-string-list.c
+++ b/test-string-list.c
@@ -41,7 +41,11 @@ static int prefix_cb(struct string_list_item *item, void *cb_data)
 	return !prefixcmp(item->string, prefix);
 }
 
+#if defined(__native_client__)
+int nacl_main(int argc, char *argv[])
+#else
 int main(int argc, char **argv)
+#endif
 {
 	if (argc == 5 && !strcmp(argv[1], "split")) {
